package cz.possoft.integration;

import java.net.URL;

/**
 * Abstract manager for various components. It manages IOC framework and return components deployed in this framework
 * when clients ask for them.
 * 
 * @author mposolda
 */
public interface ComponentManager {
	
	/**
	 * Return instance of target component. T should be class of some interface. So that container is flexible and can return
	 * any implementation of given interface.
	 * 
	 * @param <T>
	 * @param clazz
	 * @return
	 */
	public <T extends Object> T getComponentInstanceByType(Class<T> clazz);
	
	/**
	 * Return instance of component by it's name (name of deployed component in IOC framework)
	 * 
	 * @param className
	 * @return
	 */
	public Object getComponentInstanceByName(String className);
	
	/**
	 * Deployment of URL which should initialize new components based on given URL. 
	 * 
	 * @param url
	 * @throws Throwable
	 */
	public void deploy(URL url) throws Throwable;

}
